<template>
  <a-select
    v-model:value="val"
    style="width: 120px"
    ref="select"
    @change="change"
  >
    <a-select-option v-for="item of options" :key="item.value" :value="item.value">{{item.label}}</a-select-option>
  </a-select>
</template>

<script>
import { ref } from "@vue/reactivity";
export default {
  props: {
    currentVal: {
      type: String,
      required: true,
    },
    options: {
      type: Array,
      required: true,
    },
  },
  setup(props, { emit }) {
    const val = ref(props.currentVal);

    const change = (value) => {
      emit("update:currentVal", value);
    };
    return {
      val,
      change,
    };
  },
};
</script>

<style>
</style>